package application.models;

// Generated 8-dic-2011 3.00.32 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Modwineitems generated by hbm2java
 */
@Entity
@Table(name = "modwineitems", catalog = "wineshop")
public class Modwineitems implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	private Long itemId;
	private Modwinewines modwinewines;
	private int qta;
	private float price;
	private Date storeDate;
	private Set<Modwineorders> modwineorderses = new HashSet<Modwineorders>(0);
	private Set<Modwinecarts> modwinecartses = new HashSet<Modwinecarts>(0);

	public Modwineitems() {
	}

	public Modwineitems(Modwinewines modwinewines, int qta, float price,
			Date storeDate) {
		this.modwinewines = modwinewines;
		this.qta = qta;
		this.price = price;
		this.storeDate = storeDate;
	}

	public Modwineitems(Modwinewines modwinewines, int qta, float price,
			Date storeDate, Set<Modwineorders> modwineorderses,
			Set<Modwinecarts> modwinecartses) {
		this.modwinewines = modwinewines;
		this.qta = qta;
		this.price = price;
		this.storeDate = storeDate;
		this.modwineorderses = modwineorderses;
		this.modwinecartses = modwinecartses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "item_id", unique = true, nullable = false)
	public Long getItemId() {
		return this.itemId;
	}

	public void setItemId(Long itemId) {
		this.itemId = itemId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "wine_id", nullable = false)
	public Modwinewines getModwinewines() {
		return this.modwinewines;
	}

	public void setModwinewines(Modwinewines modwinewines) {
		this.modwinewines = modwinewines;
	}

	@Column(name = "qta", nullable = false)
	public int getQta() {
		return this.qta;
	}

	public void setQta(int qta) {
		this.qta = qta;
	}

	@Column(name = "price", nullable = false, precision = 12, scale = 0)
	public float getPrice() {
		return this.price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "storeDate", nullable = false, length = 10)
	public Date getStoreDate() {
		return this.storeDate;
	}

	public void setStoreDate(Date storeDate) {
		this.storeDate = storeDate;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "modwineitems")
	public Set<Modwineorders> getModwineorderses() {
		return this.modwineorderses;
	}

	public void setModwineorderses(Set<Modwineorders> modwineorderses) {
		this.modwineorderses = modwineorderses;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "modwineitems")
	public Set<Modwinecarts> getModwinecartses() {
		return this.modwinecartses;
	}

	public void setModwinecartses(Set<Modwinecarts> modwinecartses) {
		this.modwinecartses = modwinecartses;
	}

}
